#ifndef TINY_PARSER_H
#define TINY_PARSER_H

#include"hash.h"
#include"secd.h"
#include<stdio.h>

enum tiny_token_type {
    tiny_t_identify,
    tiny_t_integer,
    tiny_t_double,
    tiny_t_string,
    tiny_t_char,
    tiny_t_lp,
    tiny_t_rp
};

typedef struct _token {
    enum tiny_token_type type;
    int lineno;
    int offset;
    int length;
    struct _token *next;
} tiny_token;


tiny_token *make_token(enum tiny_token_type, int offset);
tiny_token *tiny_parse(char *code, int length);

tiny_value *tiny_compile(char *code, int length);

void display_tokens(tiny_token *);

void trans_let_to_lambda(tiny_value *value);
tiny_bytecode *tiny_compile_secd(tiny_value *);
#endif